From: Florian Müllner Date: Wed, 1 May 2019 10:34:00 +0000 (+0200) Subject: st: Consider non-background properties for ::style-changed X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~845^2^2~65 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=be40de5a9b684fe3f0d98a329bb35523ceb85dc6;p=gnome-shell.git st: Consider non-background properties for ::style-changed st_theme_node_paint_equal() was originally added to preserve paint state when a style change didn't affect any of StWidget's cached background resources. That's why using it for filtering out unneeded style changes as in commit f662864a misses any non-background related properties that are relevant for subclasses. Add additional tests to make sure we keep emitting the signal in those cases. https://gitlab.gnome.org/GNOME/gnome-shell/issues/1212 --- diff --git a/src/st/st-widget.c b/src/st/st-widget.c index a3feb1503..2b770b52e 100644 --- a/src/st/st-widget.c +++ b/src/st/st-widget.c @@ -42,6 +42,7 @@ #include "st-theme-context.h" #include "st-theme-node-transition.h" #include "st-theme-node-private.h" +#include "st-drawing-area.h" #include "st-widget-accessible.h" @@ -1826,6 +1827,27 @@ st_widget_recompute_style (StWidget *widget, st_theme_node_paint_state_invalidate (current_paint_state (widget)); } + /* It is very likely that custom CSS properties are used with StDrawingArea + to control the custom drawing, so never omit the ::style-changed signal */ + if (paint_equal) + paint_equal = !ST_IS_DRAWING_AREA (widget); + + if (paint_equal && old_theme_node->font_desc != NULL) + paint_equal = pango_font_description_equal (old_theme_node->font_desc, + st_theme_node_get_font (new_theme_node)); + + if (paint_equal && old_theme_node->foreground_computed) + { + ClutterColor col; + + st_theme_node_get_foreground_color (new_theme_node, &col); + paint_equal = clutter_color_equal (&old_theme_node->foreground_color, &col); + } + + if (paint_equal && old_theme_node->icon_colors) + paint_equal = st_icon_colors_equal (old_theme_node->icon_colors, + st_theme_node_get_icon_colors (new_theme_node)); + if (!paint_equal || !geometry_equal) g_signal_emit (widget, signals[STYLE_CHANGED], 0); else